package io.renren.modules.erp.service;

import com.baomidou.mybatisplus.extension.service.IService;
import io.renren.modules.erp.entity.Supplier;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.List;

public interface SupplierService  extends IService<Supplier> {

    Supplier getSupplier(long id)throws Exception ;

    List<Supplier> getSupplierListByIds(String ids)throws Exception;
    List<Supplier> getSupplier()throws Exception ;

    List<Supplier> select(String supplier, String type, String phonenum,
                          String telephone, String description, int currPage, int pageSize) throws Exception;
    Long countSupplier(String supplier, String type, String phonenum, String telephone, String description) throws Exception;

    int insertSupplier(String beanJson, HttpServletRequest request)throws Exception ;
    int updateSupplier(String beanJson, Long id, HttpServletRequest request)throws Exception ;
    int deleteSupplier(Long id, HttpServletRequest request)throws Exception;

    int batchDeleteSupplier(String ids, HttpServletRequest request) throws Exception;
    int checkIsNameExist(Long id, String name)throws Exception;

    int updateAdvanceIn(Long supplierId, BigDecimal advanceIn)throws Exception;

    List<Supplier> findBySelectCus()throws Exception;

    List<Supplier> findBySelectSup()throws Exception ;

    List<Supplier> findBySelectRetail()throws Exception;

    List<Supplier> findById(Long supplierId)throws Exception ;

    int batchSetEnable(Boolean enabled, String supplierIDs)throws Exception ;
    List<Supplier> findUserCustomer()throws Exception;
    List<Supplier> findByAll(String supplier, String type, String phonenum,
                             String telephone, String description) throws Exception;
    void importExcel(List<Supplier> mList) throws Exception ;

    int batchDeleteSupplierByIds(String ids,Long userId)throws Exception;
    int batchDeleteSupplierByIdsNormal(String ids,Long userId) throws Exception ;
}
